<template>
	<view style="padding: 10px;">
		<view class="border" v-for="pItem,pIndex in list" :key="pIndex" @click="toEditPage(pItem,pIndex)">
			<view class="">
				{{pItem.Content}}
			</view>
			<uni-grid :column="3" :showBorder="false">
				<view v-for="(item,index) in pItem.imglist" :key="index">
					<uni-grid-item class="imageVideo" v-if="item.Mtype==='image'||item.Mtype==='video'">
						<image :src="item.Murl" class="image" v-if="item.Mtype==='image'"></image>
						<view class="video" v-if="item.Mtype==='video'">
							<uni-icons type="videocam-filled" size="30" color="#fff"></uni-icons>
						</view>
					</uni-grid-item>
				</view>
			</uni-grid>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onShow() {
			this.list = JSON.parse(uni.getStorageSync('fromdata'))
			console.log(this.list);
		},
		methods: {
			toEditPage(item, index) {
				uni.navigateTo({
					url: '../EditPage/EditPage?data=' + JSON.stringify(item) + '&type=1&index=' + index
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.border {
		border-bottom: 1px solid #ccc;
	}

	.image {
		width: 100%;
		height: 100%;
	}
</style>
